use Operation;

package MoveEntity;
@ISA = qw/Operation/;

sub init{
    $self = shift;

    $self->dependencies(qw/LogManager/);
}

sub perform{
    $self = shift;
    $lm = $self->{LogManager};

    my ($entity, $map, $newPos) = ($self->params->{ENTITY},
				      $self->params->{MAP},
				      $self->params->{POS});


    $lm->log("Moving ".$entity." to ".$map." - (".$newPos->[0].", ".$newPos->[1].")");

    # ---- Perform the actual movement -----
    $entity->move($map, $newPos->[0], $newPos->[1]);

    my $result = ActionResult->new("SUCCESS", "OK");
    return $result;
}

1;

